<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@taglib prefix="mvc" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fmt" uri="http://www.springframework.org/tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head>
    <title new="<fmt:message code="main.newwork" />" todo="办理工作" ></title>
    <meta charset="UTF-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8 ? MYOA_CHARSET : htmlspecialchars($HTML_PAGE_CHARSET))?>" />
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" type="text/css" href="/css/workflow/m_reset.css">
    <link rel="stylesheet" type="text/css" href="/css/workflow/work/new_work.css">
    <link rel="stylesheet" type="text/css" href="/css/workflow/work/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="/css/workflow/work/handle.css"/>
    <script type="text/javascript" src="/js/jquery/jquery-1.9.1.js"></script>
    <script src="/lib/layer/layer.js?20201106"></script>
    <script src="/lib/laydate/laydate.js"></script>
    <script src="/js/jquery/jquery.cookie.js"></script>
    <script type="text/javascript" src="/lib/jquery.form.min.js"></script>
    <script type="text/javascript" src="/lib/jquery.jqprint-0.3.js"></script>
    <script type="text/javascript" src="/lib/jquery-migrate-1.1.0.js"></script>
    <script src="/js/base/base.js"></script>
    <script src="/js/mustache.min.js"></script>
    <script src="/js/workflow/work/workform.js"></script>
</head>
<style type="text/css">
    .hideen{
        display: none;
    }

    /*设置原始元素样式*/
    #origin
    {
        margin:100px auto;/*水平居中*/
        width:200px;
        height:100px;
        border:1px dashed gray;
    }
    /*设置当前元素样式*/
    #current
    {
        width:200px;
        height: 28px;
        line-height: 26px;
        color:white;
        background-color: #007BEE;
        text-align:center;
        transform:rotate(0deg);
        -webkit-transform:rotate(0deg);  /*兼容-webkit-引擎浏览器*/
        -moz-transform:rotate(0deg);     /*兼容-moz-引擎浏览器*/
        transition:all 0.5s ease-in-out;

    }
    #current:hover{
        transform: rotate(360deg);
        -webkit-transform:rotate(360deg) ;
        -moz-transform:rotate(360deg) ;
    }
    .feedbacktitle{
        position: relative;
        top:3px;
        font-weight: bold;
        margin-left: 10px;
    }
    .feedbackcontent{
        margin-left: 23px;
    }
    .backinfo{
        width:100%;
        height: 100px;
    }
    .cont{
        position: relative;
    }
    .downloadBtn{
        cursor: pointer;
        margin-left: 10px;
        display: inline-block;
    }
    .deletefileBtn{
        cursor: pointer;
        margin-left: 10px;
        display: inline-block;
    }
    .previewBtn{
        cursor: pointer;
        display: inline-block;
    }
    .editBtn{
        cursor: pointer;
        margin-left: 10px;
        display: inline-block;
    }
    #tab_c{
        width: 316px;
        height: 86% !important;
        /* display: none; */
        top: 43px;
        right: -316px;
        bottom: 0;
        position: fixed;
        background: #fff;
        overflow-y: scroll;
        box-shadow: -2px 0 20px 0px #c4c4c4;
        top: 47px;
        z-index: 22;
    }
    #tab_c,.cont_form{
        float:left;
    }
    .tab_one,#tab_ctwo{
        width:100%;
        height:100%;
    }
    .cont_ctwo{
        width:100%;
        height:100%;
    }
    .cont_cone{
        width:100%;
        height:85%;
    }
    .tab_one{
        width:100%;
        height: 200%;
    }
    .cont_cone li{
        width: 85%;
        height:50px;
        margin:10px auto;
        border: 1px solid #cccccc;
        border-radius: 3px;

    }

    .one_all,.two_all{
        width:100%;
        height:25%;
    }
    .one_all{
        border-bottom: 1px solid #ccc;
    }
    #tab_ctwo ul{
        width:100%;
        height:100%;
        display:none;
    }
    .item_logo,.item_word{
        float:left;
    }
    .item_logo{
        width: 40px;
        height: 40px;
        margin-left: 3px;
        margin-top: 5px;
        background: #00a2d4;
    }
    .item_word{
        margin-top: 5px;
        margin-left: 7px;
        width: 200px;

    }
    .item_word h1{
        text-align: left;
        color: #4b4b4b;
        font-size: 10pt;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .item_word h2{
        color: #919191;
        text-align: left;
    }
    .position{
        position: absolute;
        right: 21px;
        top: 17px;
        clear: both;
    }
    .fujian_logo,.fujian_h1,.huiqian_logo,.huiqian_h1{
        float: left;

    }
    .fujian_logo{
        margin-top: 3px;
    }
    .huiqian_logo{
        margin-top: 10px;
    }
    .fujian_h1,.huiqian_h1{
        margin-left: 5px;
        font-size: 12pt;
        margin-top: 3px;
        /*        line-height: 40px;*/
    }
    .huiqian_h1{
        line-height: 40px;
    }
    .add_fujian{
        width: 85%;
        height: 40px;
        border-radius: 7px;
        /*border: none;*/
        background: #54a9fc;
        color: #fff;
        margin: auto;
        margin-left: 24px;
        text-align: center;
        line-height: 40px;
        outline: none;
    }
    .cont_ctwo li{
        width: 90%;
        height: 70px;
        border-radius: 3px;
        margin: auto;
        border:1px solid #cccccc;
        margin-top: 7px;
    }
    .huiqian_inp,.huiqian_send{
        float:left;
    }
    .hui_inp{
        width: 81% !important;
        margin-left: -56px !important;
    }
    .huiqian_inp{
        width: 68%;
        height: 30px;
        border-radius: 3px;
        border: none;
        outline: none;
        text-align: left;
        border: 1px solid #cccccc;
        margin-left: 0px;
    }
    .huiqian_send{
        width: 15%;
        height: 30px;
        background: #ff9b30;
        color: #fff;
        margin-left: 8px;
        outline: none;
        border-radius: 3px;
        border: none;
    }
    .huiqian_word{
        width:80%;
        height:100%;
        margin-left: 4px;
        text-align: left;
    }
    .huiqian_word h1{
        margin-top: 8px;
    }
    .huiqian_word h2{
        color: #919191;
    }
    .huiqian_touxiang{
        margin-left: 2px;
    }
    .huiqian_touxiang,.huiqian_word{
        float: left;
    }
    .huiqian_word h3{
        overflow: hidden;/*内容超出后隐藏*/
        text-overflow: ellipsis;/* 超出内容显示为省略号*/
        white-space: nowrap;/*文本不进行换行*/

    }
    .huiqian_touxiang{
        width: 40px;
        height: 40px;
    }
    .layui-layer-page .layui-layer-content {

        overflow: hidden !important;
    }

    /*.choose{
       color:#fff;
        background:#4889f0 !important;
    }*/
    #remind_name,#jingban{
        height: 20px !important;
    }
    .workflow-node {
        padding: 0px !important;
    }
    .prcsName{
        width: 100%;
        height: 45px;
        background: url("../../../img/workflow/work/add_work/uncheck.png") no-repeat 20px center;
    }
    .prcsName h1 {
        text-align: center;
        line-height: 45px;
    }
    .prcsName_chang{
        color:#fff;
        background: #5B7FCB  url("../../../img/workflow/work/add_work/checked.png") no-repeat 20px center;
    }
    .fujian a,.huiqian a{
        width: 70px;
        height: 28px;
        display: block;
        text-decoration: none;
    }
    .top_one{
        position: absolute;
        top: 0px;
    }
    .top_two{
        position: absolute;
        top: 696px;
    }
    #tab_c{
        transition: all 1s ease 0s;
    }
    .list_table{
        border-width: medium;
        border-style: none;
        border-color: initial;
        border-collapse: collapse;
        word-wrap: break-word;
        table-layout: fixed;
    }
    .list_table .head {
        font-weight: 600;
    }
    .list_table td{
        border-bottom: #7F7F7F 1pt solid;
        /* border-left: #000000 2.25pt solid; */
        text-align: center;
        width: 50px;
        padding-bottom: 1px;
        padding-left: 1px;
        padding-right: 1px;
        vertical-align: middle;
        border-top: #7F7F7F 1pt solid;
        border-right: black 1pt solid;
        padding-top: 1px;
        padding: 0;
    }
    .modal-body{
        max-height: 375px !important;
    }
    .layui-layer-title{
        font-family: Microsoft yahei,Helvetica Neue,Helvetica,PingFang SC,Tahoma,Arial,sans-serif;
    }
    .orgAdd{
        display: inline-block;
        margin-top: 10px;
    }
    .userSelectBtn{
        background-image: url(../../img/userSelectBtn.png);
        width: 70px;
        height: 24px;
        background-color: rgb(238, 238, 238);
        cursor: pointer;
        margin-left: 5px;
        line-height: 23px;
        padding: 0px 6px;
        border-radius: 5px;
        border-width: 1px;
        border-style: solid;
    }
    .tabAB{
        float: left;
        position: absolute;
        background-color: #fff;
        margin-left:50%;
        width:140px;
        height:28px;
        margin-top:8px;
        display: none;
    }
    .tabAB ul{
        width: 140px;
        height: 28px;
        border: 1px solid #4889f0;
        border-radius: 5px;
    }
    .tabAB ul li{
        height:28px;
        line-height: 28px;
        width:70px;
        color:#4889f0;
        cursor: pointer;
        text-align: center;

    }
    .tabAB ul li.active{
        background: #4889f0 ;
        color:#fff;
    }
    .tabAB ul li:hover{
        background: #4889f0 ;
        color:#fff;
    }
    .clearfix:after{
        clear: both;
        display: block;
        content: '';
    }
    .fl{
        float: left;
    }
    .fr{
        float: right;
    }
    .officialDocument{
        width: 100%;
        height: 99%;
    }
    .officialDocumentLeft{
        width: 15%;
        float: left;
        border: 1px solid #4889f0;
        min-height: 400px;
        border-radius: 4px;
        margin-left:1%;
    }
    .officialDocumentLeft li{
        height: 50px;
        line-height: 49px;
        font-size: 14pt;
        text-align: center;
        font-weight: bold;
    }
    .officialDocumentLeft li:hover{
        background: #4889f0;
        color: #fff;
        cursor: pointer;
    }
    .officialDocumentLeft li.active{
        background: #4889f0;
        color: #fff;
    }
    .officialDocumentRight{
        width: 80%;
        border: 1px solid #4889f0;
        min-height: 400px;
        border-radius: 4px;
        float: right;
        margin-right:2%;
    }


    .wrap{
        width:100%;
        height:100%;
        float: left;
        clear:both;
    }
    .left_side,.right_side{
        float: left;
    }
    .left_side {
        width: 15%;
        height: 100%;
        background: #eff5f2;
    }
    .right_side{
        width:84%;
    }
    .btn {
        height: 36px;
        margin: auto;
        margin-top: 16px;
        line-height: 36px;
        color: #fff;
        text-align: center;
        cursor: pointer;
    }
    .big_btn{
        width: 70%;
        border: 1px solid rgb(5, 88, 197);
        background: #047dca;
    }
    .small_btn{
        width:40%;
        background: #fe3131;
        border:1px solid #D91600;
    }
    #EnterRevisionMode{
        width:100%;
        height:100%;
    }
    #EnterRevisionMode option{
        height: 36px;
    }
    .tipmsg{
        float: left;
        position: absolute;
        margin-left: 89px;
        margin-top: 27px;
        color: red;
        font-size: 11px;
    }
    .sms-bg-static{
        background: url("/img/images/sms-static.png") no-repeat -4px center;
        /*background-size: 100%;*/
        /*filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/img/images/sms-static.png', sizingMethod='scale');*/
        /*-ms-filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/img/images/sms-static.png', sizingMethod='scale');*/
    }
    .sms-bg-static.active{
        background: url(/img/images/sms.png) no-repeat  -6px  center;
        /*background-size: 100%;*/
        /*filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/img/images/sms.png', sizingMethod='scale');*/
        /*-ms-filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/img/images/sms.png', sizingMethod='scale');*/
    }
    .email-bg-static{
        background: url(/img/images/email-static.png) no-repeat  -6px  center;
        /*background-size: 100%;*/
        /*filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/img/images/email-static.png', sizingMethod='scale');*/
        /*-ms-filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/img/images/email-static.png', sizingMethod='scale');*/
    }
    .email-bg-static.active{
        background: url(/img/images/email.png) no-repeat  -6px  center;
        /*background-size: 100%;*/
        /*filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/img/images/email.png', sizingMethod='scale');*/
        /*-ms-filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/img/images/email.png', sizingMethod='scale');*/
    }

    .floatRight{
        position: absolute;
        top: -48px;
        width: 90px;
        height: 28px;
        border: #ccc 1px solid;
    }
    .foot_rig .floatRight>li{
        width: 100%;
        height: 28px;
        background: #fefefe;
    }
    .sms-check, .email-check, .mobile-check{
        width:20px;
    }
    .hide{display: none;}
    .show{ display: block;}
    .turnboxselect{
        margin-top: -20px;
    }
    .turnboxselectli{
        padding: 18px;
    }
    .imgupload_data{
        width: 120px;
        height: 120px;
        padding: 10px 0;
    }
</style>
<body >
<div id="tab_c">
    <div class="tab_one">
        <div class="one_all" id="fu">
            <ul class="cont_cone" style="position: relative">
                <li style="height:21px;position:relative;top:1px;border:none;"><img class="fujian_logo" src="/img/workflow/work/add_work/black.png"><h1 class="fujian_h1"><fmt:message code="email.th.file" /></h1></li>
                <li id="img_none" style="width:100%;height:50px;text-align: center;line-height:50px;margin-top: 20px;border: none;">
                    <img src="/img/workflow/work/img_nomessage_03.png" alt="">
                    <span style="    display: block;
   "> <fmt:message code="main.th.AssociationData" /></span>
                </li>
                <div class="position backbtn"><img src="/img/workflow/work/add_work/back.png"></div>
                <div id="oneUploadFile">
                </div>
            </ul>
            <span style="display: inline-block;cursor: pointer" class="add_fujian" id="add_fujian"><fmt:message code="email.th.addfile" /></span>
            <form id="uploadimgform" target="uploadiframe" action="workUpload?module=workflow" enctype="multipart/form-data" method="post" >
                <input type="file" multiple="multiple" name="file" id="uploadinputimg"  class="w-icon5" style="display:none;">
                <input type="hidden" id="uprunId" name="runId">
            </form>
        </div>
        <div class="two_all" id="hui">
            <ul class="cont_ctwo" style="position: relative">
                <li style="height:33px;border: none;"><img class="huiqian_logo" src="/img/workflow/work/add_work/black.png"><h1 class="huiqian_h1"><fmt:message code="workflow.th.JointlySign" /></h1></li><div class="position backbtn"><img src="/img/workflow/work/add_work/back.png"></div>
                <li style="height:33px;border: none;"><input type="text" id="signText" class="huiqian_inp hui_inp"><button class="huiqian_send" id="signSendBtn">提交</button></li>
                <div id="signbox">
                    <li style="width:100%;height:50px;text-align: center;line-height:50px;margin-top: 20px;border: none;">
                        <img src="/img/workflow/work/img_nomessage_03.png" alt="">
                        <span style="    display: block;
    "> <fmt:message code="main.th.AssociationData" /></span>
                    </li>
                </div>
            </ul>
        </div>

    </div>
    <div id="tab_ctwo">
        <ul class="cont_cthr" >
            <iframe frameborder="0" width="100%" height="100%" marginheight="0" marginwidth="0" scrolling="no" src=""></iframe>
        </ul>
        <ul class="cont_cfour" style="display: block;position: relative;">
            <li style="width:100%;height:50px;text-align: center;line-height:50px;margin-top: 20px;">
                <img src="/img/workflow/work/img_nomessage_03.png" alt="">
                <span style="    display: block;
    "> <fmt:message code="main.th.AssociationData" /></span>
            </li><div class="position backbtn"><img src="/img/workflow/work/add_work/back.png"></div>
        </ul>
    </div>

</div>
<div class="body">
    <div class="head" style="position: relative">
        <div id="title" class="abs_left">
            <h1 class="num"></h1>
            <h2 class="step hideen"></h2>
            <select class="opt hideen" style="float: left">
                <option value="1"><fmt:message code="sup.th.ordinary" /></option>
                <option value="2"><fmt:message code="sup.th.urgent" /></option>
            </select>
            <div class="tabAB">
                <ul class="clearfix">
                    <li class="fl active" data-id="1" ><fmt:message code="workflow.th.form" /></li>
                    <li class="fl" data-id="2" ><fmt:message code="main.th.text" /></li>
                </ul>
            </div>
        </div>

        <div id="tab_t" class="abs_right">
            <ul>
                <li class="fujian"><a  href="#fu"><fmt:message code="email.th.file" /></a></li>
                <li class="huiqian" ><a  href="#hui"><fmt:message code="document.th.JointlySign" /></a></li>
                <li class="liucheng"><fmt:message code="doc.th.TechnologicalProcess" /></li>
                <li class="guanlian" style="border-right: none"><fmt:message code="document.th.Relation" /></li>
            </ul>
        </div>
    </div>
    <div class="content">
        <div class="cont" id="client">
            <div class="cont_form" id="a2">
            </div>
            <div class="officialDocument clearfix" style="display: none">
                <iframe id="zw" name="zw" src="" frameborder="0" scrolling="yes" height="100%" width="100%" noresize="noresize" tid="2"></iframe>
            </div>
        </div>
        <div class="foot">
            <div class="foot_left">
                <ul>
                    <li class="left_li" id="flowImg"><img class="left_img" src="/img/workflow/work/add_work/sheji.png"><h1 class="left_h1"><fmt:message code="workflow.th.chart" /></h1></li>
                    <%--  <li class="left_li"><img class="left_img" src="../../img/workflow/work/add_work/weituo.png"><h1 class="left_h1">委托</h1></li>--%>
                    <li class="left_li" id="print"><img class="left_img" src="/img/workflow/work/add_work/print.png"><h1 class="left_h1"><fmt:message code="global.lang.print" /></h1></li>
                    <li class="left_li" id="attach_name"><img class="left_img" src="/img/workflow/work/add_work/lan.png"><h1 class="left_h1" ><fmt:message code="email.th.file" /></h1></li>
                </ul>
            </div>
            <div class="foot_rig" id="foot_rig" >
                <ul>
                    <li class="rig_li more baocunfanhui"  style="position: relative">
                        <ul class="floatRight" style="position: absolute;display: none;">
                            <li id="fenxiang">分享公告</li>
                        </ul>

                        <h1 class="rig_h1 rig_h1one">更多操作</h1></li>
                    <li class="rig_li saveformlo" id="cancleBtn"><h1 class="rig_h1"><fmt:message code="depatement.th.quxiao" /></h1></li>
                    <li class="rig_li baocunfanhui" id="saveformback"><h1 class="rig_h1"><fmt:message code="main.th.SaveReturn" /></h1></li>
                    <li class="rig_li saveformlo" id="saveform"><h1 class="rig_h1"><fmt:message code="global.lang.save" /></h1></li>
                    <li class="rig_li hideen saveformlo" id="goback"><h1 class="rig_h1 "><fmt:message code="document.th.Fallback" /></h1></li>
                    <li class="rig_li zhuanjiao rig_h1onexiayibu"><h1 class="rig_h1"><fmt:message code="document.th.nextStep" /></h1></li>
                </ul>

            </div>
        </div>
    </div>
    <div id="printdiv">
    </div>
    <script type="text/javascript" src="/js/spirit/qwebchannel.js"></script>
    <script>

        //控制高度
        autodivheight();
        function autodivheight(){
            var winHeight=0;
            if (window.innerHeight)
                winHeight = window.innerHeight;
            else if ((document.body) && (document.body.clientHeight))
                winHeight = document.body.clientHeight;
            if (document.documentElement && document.documentElement.clientHeight)
                winHeight = document.documentElement.clientHeight;
            winWidth = document.documentElement.clientWidth;
            document.getElementById("client").style.height= winHeight - 95 +"px";
            document.getElementById("client").style.width= winWidth  +"px";
        }
        window.onresize=autodivheight;
    </script>
    <script>
        function allamplification(me) {
//        var str='<div id="allamplification" style="text-align:center;position: fixed;top: 0;left: 0;right: 0;bottom: 0;background-color:rgba(000,000,000,0.5);">' +
//            '<b style="position: absolute;display:inline-block;width: 50px;height: 50px;line-height: 50px' +
//            ';border-radius:50%;background:#333;top: 20px;right: 50px;color: #fff;cursor:pointer;font-size: 22px;font-weight: bold;" onclick="clearHtml(this)">x</b>' +
//            '<img src="'+$(me).attr('src')+'" style="margin-top:20px;display: inline-block;width: 100%!important;height: 100%!important;" alt="">' +
//            '</div>'
//        $('body').append(str)
            var imgs=$(me).attr('src');
            var wt=(document.documentElement.clientWidth || document.body.clientWidth)*0.8;
            var ht=(document.documentElement.clientHeight || document.body.clientHeight)*0.8;
            layer.open({
                type: 1,
                title: false,
                closeBtn: 0,
                area:['auto'],
//                offset:'100px',
                skin: 'layui-layer-nobg', //没有背景色
                shadeClose: true,
                content:
//                '<img src="'+imgs+'" width="'+wt+'" height="'+ht+'">'
                '<div style="max-width: '+wt+'px;max-height:'+ht+'px;text-align: center">' +
                '<img src="'+imgs+'" style="max-width:'+wt+'px;max-height: '+ht+'px;">' +
                '</div>'
            });



            $(document).on('click','.layui-layer-nobg',function () {
                layer.closeAll()
            })
        }
        function clearHtml(me) {
            $(me).parent().remove();
        }
        var globalData = {};
        $(function(){
            // domain;
            var flowId = $.getQueryString("flowId");
            $('.cont_cthr').find('iframe').prop('src','/flowSetting/processDesignToolsT?type=2&flowId='+flowId)
            var flowStep = $.getQueryString("flowStep") || '';
            var prcsId = $.getQueryString("prcsId") || '';
            var runId = $.getQueryString("runId") || '';
            var type = $.getQueryString("type") || '';
            var tableName = $.getQueryString("tableName") || '';
            var tabId =  $.getQueryString("tabId") || '';
            var isNomalType =  $.getQueryString("isNomalType") || '';
            var iconImgType = {
                txt : '/img/icon_file.png',
                jpg : '/img/icon_image.png',
                png : '/img/icon_image.png',
                pdf :  '/img/icon_pdf.png',
                ppt : '/img/icon_ppt.png',
                pptx :  '/img/icon_ppt.png',
                doc : '/img/icon_word.png',
                docx : '/img/icon_word.png',
                xls :  '/img/icon_excel.png',
                xlsx :  '/img/icon_excel.png',

            }
            $('#tab_c').css('right',-($('#tab_c').width()))
            $('#tab_c').css('height',$('#tab_c').height()-$('.head').height()-$('.foot').height())
            $('#tab_c').css('top',$('.head').height());

            $('.rig_h1one').click(function(){
                $('.floatRight').toggle();
            })
            var flowId = $.GetRequest().flowId|| '';
            var flowStep = $.GetRequest().flowStep || '';
            var runId = $.GetRequest().runId || '';
            var prcsId=$.GetRequest().prcsId || '';
            $('#fenxiang').click(function(){
                window.open("/workflow/work/notifyWork?flowId="+flowId+"&type=todo&prcsId="+prcsId+"&flowStep="+flowStep+"&runId="+runId);
            })
            if(isNomalType == 'false'){
                $('.tabAB').show();
                if(tabId != ''){
                    $('#zw').prop('src','../../common/ntko?tabId='+tabId+'&tableName='+tableName);
                }

                $('.tabAB ul li').click(function () {
                    $(this).siblings().removeClass('active');
                    $(this).addClass('active');
                    if($(this).attr('data-id')==1){
                        $('#a2').show();
                        $('#tab_t').show();
                        $('.officialDocument').hide()
                    }else {
                        $('#a2').hide();
                        $('#tab_t').hide();
                        $('.officialDocument').show()
                    }
                });
            }else{
                $('.opt').show();
                $('.step').show()
            }
            //引入方法
            workForm.init({
                    formhtmlurl:'../../workflow/work/workfastAdd',//URL
                    resdata:{
                        flowId:flowId,
                        runId:runId,
                        prcsId:prcsId,
                        flowStep:flowStep
                    },
                    flowStep:prcsId,//预览
                    target:'.cont_form'},
                function (data,option) {
                    if($.GetRequest().flowId==200){
                        $.get('/gridEvent/selectByPrimaryKey',{eventId:$.GetRequest().tabId},function(json){
                            if(json.flag){
                                var arr=json.data.attachments2;
                                var str='';
                                for(var i=0;i<arr.length;i++){
                                    str+= '<img onclick="allamplification(this)" style="width: 120px;height: 120px;margin-left:10px;margin-top:10px;display: inline-block" src="/xs?'+arr[i].attUrl+'" alt="">'
                                }
                                $('#tupian').html(str)
                            }
                        },'json')
                    }
                    if($.GetRequest().flowId==205){
                        $.get('/gridEvent/selectByPrimaryKey',{eventId:$.GetRequest().tabId},function(json){
                            if(json.flag){
                                var arr=json.data.attachments2;
                                var str='';
                                for(var i=0;i<arr.length;i++){
                                    str+= '<img onclick="allamplification(this)" style="width: 120px;height: 120px;margin-left:10px;margin-top:10px;display: inline-block" src="/xs?'+arr[i].attUrl+'" alt="">'
                                }
                                $('#tupian').html(str)
                            }
                        },'json')
                    }
                    if($.GetRequest().flowId==204){
                        $.get('/gridEvent/selectByPrimaryKey',{eventId:$.GetRequest().tabId},function(json){
                            if(json.flag){
                                var arr=json.data.attachments2;
                                var str='';
                                for(var i=0;i<arr.length;i++){
                                    str+= '<img onclick="allamplification(this)" style="width: 120px;height: 120px;margin-left:10px;margin-top:10px;display: inline-block" src="/xs?'+arr[i].attUrl+'" alt="">'
                                }

                                $('#tupian').html(str)
                            }
                        },'json')
                    }
                    if($.GetRequest().flowId==201){
                        $.get('/gridEvent/selectByPrimaryKey',{eventId:$.GetRequest().tabId},function(json){
                            if(json.flag){
                                var arr=json.data.attachments2;
                                var str='';
                                for(var i=0;i<arr.length;i++){
                                    str+= '<img onclick="allamplification(this)" style="width: 120px;height: 120px;margin-left:10px;margin-top:10px;display: inline-block" src="/xs?'+arr[i].attUrl+'" alt="">'
                                }

                                $('#tupian').html(str)
                            }
                        },'json')
                    }
                    fromDataReject = buildFormData();
                    runId = data.object.flowRun.runId;
                    globalData.flowRun = data.object.flowRun;
                    globalData.listFp = data.object.listFp;
                    globalData.flowRunPrcs = data.object.flowRunPrcs;
                    globalData.option = option;
                    globalData.flowTypeModel = data.object.flowTypeModel;
                    globalData.conditionDesc = data.object.conditionDesc;
                    globalData.prcsIn = data.object.prcsIn;
                    globalData.flowProcesses = data.object.flowProcesses;
                    globalData.prcsInSet = data.object.prcsInSet;
                    globalData.prcsOut = data.object.prcsOut;
                    globalData.prcsOutSet = data.object.prcsOutSet;
                    var flowName = globalData.flowTypeModel.flowName || '';
                    if(type){
                        if(type == 'new'){
//                            $('title').html($('title').attr(type)+'-'+flowName);
                        }else{
//                            $('title').html($('title').attr(type)+'-'+globalData.flowRun.runName);
                        }

                    }

                    flowPrcs =  data.object.flowRunPrcs.flowPrcs;
                    prcsPrivlist = option.prcsPrivlist;
                    prcsUserlist = option.prcsUserlist;
                    prcsDeptlist = option.prcsDeptlist;
                    feedback = data.object.feedback;
                    attachPriv = data.object.attachPriv;
                    allowBack = data.object.allowBack;
                    signlock = data.object.signlock;
                    if(feedback == '1'){
                        $('#signText').attr("disabled","disabled")
                    }
                    if(allowBack != 0){
                        $("#goback").show();
                        $("#goback").attr("allowBack",allowBack);
                        $("#goback").click(function () {
                            $.ajax({
                                type: "get",
                                url: "getflowprcsdata",
                                dataType: 'JSON',
                                data: {
                                    prcsId: flowStep,
                                    runId: runId,
                                    allowBack:$('#goback').attr('allowback')
                                },
                                success: function (res) {
                                    if(res.flag){
                                        var feedbackLiObj = "";
                                        res.obj.forEach(function(v,i){
                                            feedbackLiObj += '<li><input type="radio" name="feedbackstep" class="" flowPrcs="'+v.flowProcess.prcsId+'" ><span class="feedbacktitle"><fmt:message code="workflow.th.First" />'+v.prcsId+'<fmt:message code="workflow.th.step" />'+v.flowProcess.prcsName+'</span><div class="feedbackcontent"><fmt:message code="sup.th.Sponsor" />：'+v.userName+'&nbsp;&nbsp;&nbsp;<fmt:message code="workflow.th.Settlingtime" />：'+v.prcsTime+'</div></li>';
                                        });
                                        layer.open({
                                            type: 1,
                                            offset: '80px',
                                            area: ['800px', '500px'],
                                            closeBtn: 2,
                                            title: titleName,
                                            content: '<div class="modal-body" style="max-height: 274px;">' +
                                            '<div class="work-prcs-title" id="op_user_show_info" style="margin-bottom: 10px;font-weight: normal;border-radius: 4px;-webkit-border-radius: 4px;">' +
                                            '<fmt:message code="document.th.SelectReturnStep" />：' +
                                            '</div><div class="work-prcs-block">' +
                                            '<div class="work-prcs-content clearfix" style="border: 1px solid #f3f3f3;"><div class=" workflow-procs-nodes-result-wrap">' +
                                            '<ul id="work-next-prcs-block" class="workflow-procs-nodes-result" style="top: 0px; margin-left: 30px;word-spacing: 0px;">' +feedbackLiObj+
                                            '</ul></div></div></div><div class="work-msg-block">' +
                                            '<div class="work-msg-title"><a id="msg-control" href="#"><img style="vertical-align: text-top; margin-top: 5px;" src="/img/workflow/work/add_work/form_down.png"></a> <fmt:message code="document.th.InputReturnOpinion" />：</div>' +
                                            '<div class="work-msg-content" style="display: block;"><div class="clearfix"><textarea id="feedback" class="backinfo"></textarea>' +
                                            '</div></div></div></div>',
                                            btn: ['<fmt:message code="main.th.confirm" />', '<fmt:message code="depatement.th.quxiao" />'],
                                            success: function (layero, index) {


                                            },
                                            yes: function(index, layero){
                                                var feedback = $('#feedback').val();
                                                var backflowPrcs = $("input[name='feedbackstep']:checked").attr('flowPrcs');
                                                if(backflowPrcs == ''){
                                                    $.layerMsg({content:'<fmt:message code="main.th.FallbackStep" />！',icon:3},function(){
                                                    });
                                                    return false;
                                                }
                                                if(feedback == ''){
                                                    $.layerMsg({content:'<fmt:message code="main.th.ReturnOpinion" />！',icon:3},function(){
                                                    });
                                                    return false;
                                                }
                                                $.ajax({
                                                    type: "get",
                                                    url: "insertprcsdata",
                                                    dataType: 'JSON',
                                                    data: {
                                                        flowPrcs : backflowPrcs,
                                                        prcsId : prcsId,
                                                        flowStep:flowStep,
                                                        runId : runId,
                                                        feedback : $('#feedback').val()
                                                    },
                                                    success: function (res) {
                                                        if(res.flag){
                                                            $.layerMsg({content:'<fmt:message code="document.th.RollbackSuccessful" />！',icon:1},function(){
                                                                window.close();
                                                                parent.opener.runWorkListPage();
                                                            });
                                                        }else{
                                                            $.layerMsg({content:'<fmt:message code="document.th.RollbackFailed" />！',icon:2},function(){
//                                                            layer.closeAll();
                                                            });
                                                        }
                                                    }
                                                });
                                            }
                                        });
                                    }
                                }
                            });
                        });
                    }
                    initSlideBar(prcsId,flowPrcs,runId);
                    var obj=data.object.flowRun
                    var  titleName=obj.runName;
                    $('.num').html(titleName);
                    var obj2 = [];
                    var listFp = data.object.listFp;
                    for(var i=0;i<listFp.length;i++){
                        if(listFp[i]!=undefined&&listFp[i].prcsId==prcsId){
                            obj2=listFp[i];
                        }
                    }
                    $('.step').html('<fmt:message code="workflow.th.host" />：(<fmt:message code="workflow.th.First" />'+flowStep+'<fmt:message code="workflow.th.step" />：'+obj2.prcsName+')');
                    $('#add_fujian').click(function(){
                        if(checkttachPriv(1)){
                            $('#uprunId').val(data.object.flowRun.runId);
                            $('#uploadinputimg').click();
                        }else{
                            $.layerMsg({content:'<fmt:message code="document.th.AttachmentPermission" />！',icon:6},function(){
                            });
                        }
                    });
                });

            function buildFormData(){
                var arr = {};
                $(".cont_form").find('.form_item').each(function(i,v){
                    var _this = $(this);
                    arr[_this.attr('title')] = _this.attr('name');
                });
                return arr;
            }
            function checkttachPriv(privNum){
                if(attachPriv.indexOf(privNum) > -1){
                    return true;
                }
                return false   ;
            }
            function checkFeeback(){
                if(feedback != '1' ){
                    return true;
                }
                return false;
            }
            $('#oneUploadFile').on('click','.downloadBtn',function () {
                var _this = $(this);
                if(checkttachPriv(4)){
                    var url = _this.attr("atturl")
                    window.location="../../download?"+url;
                }else{
                    $.layerMsg({content:'<fmt:message code="document.th.permissionDownload" />！',icon:6},function(){
                    });
                }
            });
            $('#cancleBtn').click(function(){
                window.close();
            });
            $('#oneUploadFile').on('click','.deletefileBtn',function () {
                var _this = $(this);
                if(checkttachPriv(3)){
                    var url =  'deletework?runId='+runId+'&'+_this.attr("atturl");
                    $.get(url,function(data,status){

                        if(data.flag){
                            $.layerConfirm({title:'<fmt:message code="menuSSetting.th.suredeleteMenu" />',content:'<fmt:message code="workflow.th.que" />？',icon:0},function(){
                                $.layerMsg({content:'<fmt:message code="workflow.th.delsucess" />！',icon:1},function(){
                                    _this.parent().parent().remove();
                                });
                            },function(){

                            });
                        }else{
                            $.layerMsg({content:'<fmt:message code="lang.th.deleSucess" />！',icon:2},function(){

                            });
                        }
                    });
                }else{
                    $.layerMsg({content:'<fmt:message code="document.th.DeletePermissions" />！',icon:6},function(){
                    });
                }
            });
            $('#oneUploadFile').on('click','.previewBtn',function () {
                var _this = $(this);
                var atturl = _this.attr("atturl");

                if(_this.parent().parent().find('.item_logo img').attr('src') == "/img/icon_image.png"){
                    $.popWindow("/xs?"+atturl,'<fmt:message code="main.th.PreviewPage" />','0','0','1500px','800px');
                }else{
                    $.popWindow("/common/ntkoPreview?"+atturl,'<fmt:message code="main.th.PreviewPage" />','0','0','1500px','800px');
                }

            });
            $('#oneUploadFile').on('click','.editBtn',function () {
                var _this = $(this);
                if(checkttachPriv(2)){
                    $.layerMsg({content:'<fmt:message code="sup.th.UnderDevelopment" />！',icon:6},function(){

                    });
                }else{
                    $.layerMsg({content:'<fmt:message code="document.th.HaveEditRights" />！',icon:6},function(){

                    });
                }
            });

            $('#print').click(function(){
                if(checkttachPriv(5)){
                    $('.cont_form').jqprint();
                }else{
                    $.layerMsg({content:'<fmt:message code="document.th.printPermissions" />！',icon:6},function(){

                    });
                }
            });
            $("#signSendBtn").click(function() {

                if(checkFeeback()){
                    var text = $('#signText').val();
                    if(feedback == '2'){//  强制会签
                        if(text == ''){
                            $.layerMsg({content:'<fmt:message code="document.th.Countersign" />！',icon:5},function(){

                            });
                            return false;
                        }
                    }
                    $.ajax({
                        type: "get",
                        url: "workfeedback",
                        dataType: 'JSON',
                        data: {
                            prcsId:prcsId,
                            flowPrcs:flowPrcs,
                            runId:runId,
                            content:text,
                            file:''
                        },
                        success: function (obj) {
                            $('#signText').val('');
                            initSlideBar(prcsId,flowPrcs,runId);

                        }
                    });
                }else{
                    $.layerMsg({content:'<fmt:message code="document.th.permissionToCountersign" />！',icon:6},function(){

                    });
                }

            });
            function initSlideBar(prcsId,flowPrcs,runId){
                initSign(prcsId,flowPrcs,runId);
                initUpload(runId);
            }
            function initUpload(runId) {
                $.ajax({
                    type: "get",
                    url: "findworkUpload",
                    dataType: 'JSON',
                    data: {
                        runId:runId
                    },
                    success: function (obj) {
                        if(obj.flag){
                            var str = '';
                            obj.obj.forEach(function (v,i) {
                                var arr = v.attachName.split('.');
                                var imgurl = iconImgType[arr[arr.length-1]] || '/img/icon_file.png';

                                str += ' <li><div class="item_logo"><img src="'+imgurl+'"></div><div class="item_word"><h1>'+v.attachName+'</h1><h2></h2></div><div  class="item_word"><h2  attUrl="'+v.attUrl+'" class="previewBtn"><fmt:message code="global.lang.view" /></h2><h2  attUrl="'+v.attUrl+'" class="downloadBtn"><fmt:message code="file.th.download" /></h2><h2  attUrl="'+v.attUrl+'" class="editBtn"><fmt:message code="global.lang.edit" /></h2><h2  attUrl="'+v.attUrl+'" class="deletefileBtn"><fmt:message code="global.lang.delete" /></h2></div></li>';
                            });
                            if( obj.obj.length>0){
                                $('#img_none').hide();
                            }
                            $('#oneUploadFile').html(str)
                        }

                    }
                });
            }
            $('#uploadinputimg').change(function(e){
                var target = $(e.target);
                var file;
                if(target[0].files && target[0].files[0]){
                    file=target[0].files[0];
                }
                if(file){
                    layer.load();
                    $('#uploadimgform').ajaxSubmit({
                        type: 'post',
                        dataType: 'json',
                        success: function (res) {
                            if(res.flag){
                                $('#uploadinputimg').val('');
                                var data=res.obj;
                                var str=''
                                data.forEach(function (v,i) {
                                    var arr = v.attachFile.split('.');
                                    var imgurl = iconImgType[arr[arr.length-1]] || '/img/workflow/work/zip.png';
                                    var str2 = '';
                                    var style = 'margin-left: 0px;';
                                    if(imgurl.substring(imgurl.lastIndexOf('/')+1,imgurl.lastIndexOf('.'))=='doc'){
                                        str2 = '<h2 attUrl="'+encodeURI(v.attUrl)+'" class="editBtn item_wordH2"><fmt:message code="global.lang.edit" /></h2> ';
                                    }
                                    str += ' <li><div class="item_logo"><img src="'+imgurl+'"></div>' +
                                        '<div class="item_word" style="margin-top: 8px;letter-spacing: 1px;"><h1 class="item_wordH1" style="font-size: 11pt;" title="'+v.attachName+'">'+v.attachName+'</h1><h2></h2></div>' +
                                        '<div class="item_word" style="margin-top: 2px;font-size: 9pt;">' +function(){
                                            if($.UrlGetRequest('?'+v.attUrl) != 'exe' && $.UrlGetRequest('?'+v.attUrl) != 'rar' && $.UrlGetRequest('?'+v.attUrl) != 'zip'){
                                                style = 'margin-left: 10px;';
                                                return '<h1 class="previewBtn item_wordH2" style="margin-left: 0;" attUrl="'+encodeURI(v.attUrl)+'"><fmt:message code="global.lang.view" /></h1>';
                                            }else{
                                                return '';
                                            }
                                        }()+ '<h1 class="downloadBtn item_wordH2" attUrl="'+encodeURI(v.attUrl)+'" style="'+ style +'"><fmt:message code="file.th.download" /></h1>' +
                                        str2+
                                        '<h1 class="deletefileBtn item_wordH2" attUrl="'+encodeURI(v.attUrl)+'"><fmt:message code="global.lang.delete" /></h1>'+
                                        '</div></li>';
                                });
                                if($('#img_none')!=null||$('#img_none')!=undefined){
                                    $('#img_none').hide();
                                }
                                layer.closeAll();
                                $.layerMsg({content:'上传成功！',icon:1},function(){
                                });
                                $('#oneUploadFile').show();
                                $('#oneUploadFile').append(str)
                            }else {
                                layer.closeAll();
                                $.layerMsg({content:'上传失败！',icon:2},function(){
                                });
                            }
                        }
                    });

                }
            });
            function checkPrcIn(prcsIn,prcsInSet,formdata,fromDataReject,cb){
                var res = {
                    flag:true,
                    msg:''
                };
                if(prcsInSet != ""){
                    var prcsInArr = prcsIn.split('\n');
                    formdata = covertToFormData(formdata);

                    prcsInArr.forEach(function(v,i){
                        var check_pass = 0;
                        var titleValue = '';
                        if(v.indexOf("'") > -1){
                            var arr_rule = v.split("'");

                            var item_title = myTrim(arr_rule[1]);
                            var item_con = myTrim(arr_rule[2]);
                            var item_value = myTrim(arr_rule[3]);
                            titleValue = formdata[fromDataReject[item_title]];
                            check_pass = checkTileValue(titleValue,item_con,item_value);
                            var setitem =  '['+(i+1)+']'
                            prcsInSet = prcsInSet.replace(setitem,check_pass);
                        }
                    });
                    prcsInSet = covertToPrcsOutSet(prcsInSet.toLowerCase());

                    var result = eval(prcsInSet);

                    if(result == 0){
                        res.flag = false;
                    }
                }
                if(cb){
                    cb(res);
                }
            };
            function covertToFormData(formdata){
                var data = {};
                if(formdata instanceof Array){
                    formdata.forEach(function(v,i){
                        data[v.key] =  v.value;
                    });
                }
                return data;
            }
            function covertToPrcsOutSet(data){
                data = data.replace(/or/g,'||')
                data = data.replace(/and/g,'&&')
                return data;
            }
            function checkPrcOut(formdata,fromDataReject,cb){
                var msg = globalData.conditionDesc.split('\n')[1];
                var res = {
                    flag:true,
                    msg:""
                };
                if(msg){
                    res.msg = msg;
                }else{
                    res.msg =  '<fmt:message code="main.th.NonConformity" />'
                }
                var prcsOut = globalData.prcsOut;
                var prcsOutSet = globalData.prcsOutSet;
                if(prcsOutSet != ""){
                    var prcsOutArr = prcsOut.split('\n');
                    formdata = covertToFormData(formdata);
                    prcsOutArr.forEach(function(v,i){
                        var check_pass = 0;
                        var titleValue = '';
                        var arr_rule = v.split("'");
                        var item_title = myTrim(arr_rule[1]);
                        var item_con = myTrim(arr_rule[2]);
                        var item_value = myTrim(arr_rule[3]);
                        titleValue = formdata[fromDataReject[item_title]];
                        check_pass = checkTileValue(titleValue,item_con,item_value);
                        var setitem =  '['+(i+1)+']'
                        prcsOutSet = prcsOutSet.replace(setitem,check_pass);
                    });
                    prcsOutSet = covertToPrcsOutSet(prcsOutSet.toLowerCase());
                    var result = eval(prcsOutSet);

                    if(result == 0){
                        res.flag = false;
                    }
                }
                if(cb){
                    cb(res);
                }
            };
            function checkTileValue(item_title,rule,item_value){
                var checkpass = 0;
                var item_title = parseInt(item_title) || item_title;
                var item_value = parseInt(item_value) || item_value;
                switch (rule) {
                    case '=':
                        if (item_title == item_value) {
                            checkpass = 1;
                        }
                        break;
                    case '!=':
                        if (item_title != item_value) {
                            checkpass = 1;
                        }
                        break;
                    case '>':
                        if (item_title > item_value) {
                            checkpass = 1;
                        }
                        break;
                    case '<':
                        if (item_title < item_value) {
                            checkpass = 1;
                        }
                        break;
                    case '<=':
                        if (item_title <= item_value) {
                            checkpass = 1;
                        }
                        break;
                    case '>=':
                        if (item_title >= item_value) {
                            checkpass = 1;
                        }
                        break;
                    case 'include':
                        if (item_title.indexOf(item_value) > -1) {
                            checkpass = 1;
                        }
                        break;
                    case 'exclude':
                        if (item_title.indexOf(item_value) == -1) {
                            checkpass = 1;
                        }
                        break;
                }
                return checkpass;
            }
            function renderPrcsSet(data){

            }
            function myTrim(x) {
                return x.replace(/^\s+|\s+$/gm,'');
            }
            function initSign(prcsId,flowPrcs,runId){
                $.ajax({
                    type: "get",
                    url: "findworkfeedback",
                    dataType: 'JSON',
                    data: {
                        prcsId:prcsId,
                        signlock:signlock,
                        flowPrcs:flowPrcs,
                        runId:runId
                    },
                    success: function (obj) {
                        if(obj.flag){
                            if(obj.obj.length!=0){
                                var str = '';
                                obj.obj.forEach(function (v,i) {
                                    var avatar = v.users.avatar;
                                    if (avatar==0){
                                        str += '<li><div class="huiqian_touxiang"><img class="huiqian_logo" src="/img/user/boy.png"></div><div class="huiqian_word"><h1>'+v.users.userName+'</h1><h2>'+v.editTime+'</h2><h3 title="'+v.content+'">'+v.content+'</h3></div></li>';
                                    }else {
                                        str += '<li><div class="huiqian_touxiang"><img class="huiqian_logo" src="/img/user/girl.png"></div><div class="huiqian_word"><h1>'+v.users.userName+'</h1><h2>'+v.editTime+'</h2><h3 title="'+v.content+'">'+v.content+'</h3></div></li>';
                                    }

                                });
                                $('#signbox').html(str)


                            }
                        }
                    }
                });
            }
            //第一个
            $('.fujian').on('click',function(){
                $('.fujian').find('a').css('color','#fff');
                $('.huiqian').find('a').css('color','#4889f0');
                $(this).siblings().removeClass("check");
                $(this).addClass('check');
                $('#tab_c').css('right','0px')
//           $('#tab_c').animate({width:"316px"});
                $('#tab_ctwo').hide();
                $('.tab_one').show();

            })
            //第二个
            $('.huiqian').on('click',function(){
                $('.fujian').find('a').css('color','#4889f0');
                $(this).find('a').css('color','#fff');
                $(this).siblings().removeClass("check");
                $(this).addClass('check');
                $('#tab_c').css('right','0px')
                $('#tab_ctwo').hide();
                $('.tab_one').show();

            });
            //第三个
            $('.liucheng').on('click',function(){
                $('.huiqian').find('a').css('color','#4889f0');
                $('.fujian').find('a').css('color','#4889f0');
                $(this).siblings().removeClass("check");
                $(this).addClass('check');
                $('#tab_c').css('right','0px')
                $('.cont_cthr').siblings().hide();
                $('.tab_one').hide();
                $('#tab_ctwo').show();
                $('.cont_cthr').show();
            })
            //第四个
            $('.guanlian').on('click',function(){
                $('.huiqian').find('a').css('color','#4889f0');
                $('.fujian').find('a').css('color','#4889f0');
                $(this).siblings().removeClass("check");
                $(this).addClass('check');
                $('#tab_c').css('right','0px')
                $('.cont_cfour').siblings().hide();
                $('.tab_one').hide();
                $('#tab_ctwo').show();
                $('.cont_cfour').show();
            })
            $('.position').on('click',function () {
                $('#tab_c').css('right',-$('#tab_c').width())
            })
            //点击左下角的附件
            $('#attach_name').on('click',function(){

                $('#tab_c').animate({right:'0px'},"slow");

            })
            function subPric(source,pos) {
                var strs= new Array(); //定义一数组
                strs=source.split(pos); //字符分割
                return strs;
            }
            $('#flowImg').click(function(){
                if(typeof(qt) == 'undefined'){
                    $.popWindow('/flowSetting/processDesignToolTwo?flowId='+flowId+'&rilwId='+runId,'<fmt:message code="workflow.th.chart" />','0','0','1200px','800px');
                }else{
                    new QWebChannel(qt.webChannelTransport, function(channel){
                        var content = channel.objects.interface;
                        content.xoa_sms('/flowSetting/processDesignToolTwo?flowId='+flowId+'&rilwId='+runId,'<fmt:message code="workflow.th.chart" />',"web_child_url");
                    });
                }
            });
            $('#saveform').click(function(){
                saveFlowData(function(){
                    $.layerMsg({content:'<fmt:message code="diary.th.modify" />！',icon:1},function(){

                    });
                });
            });
            $('#saveformback').click(function(){
                saveFlowData(function(){
                    window.close();
                });
            });
            function saveFlowData(cb) {
                var flowfun = globalData.flowRun;
                var form_item=$('.cont_form .form_item');
                var realData=[];
                var radioArr = {};
                var modifydata =[];
                var flag = false;
                for(var i=0;i<form_item.length;i++){
                    var baseData={};
                    var value="";
                    var obj = form_item.eq(i);
                    var datatype = obj.attr("data-type");
                    var key=obj.attr("name");
                    var ismust = obj.attr('ismust');
                    if(datatype=="select"){
                        value= obj.val()==0?'':form_item.eq(i).val();
                    }else if(datatype=="textarea" || datatype=="text"  ){
                        value=obj.val();
                    }else if(datatype=="checkbox"){
                        value=obj.attr('title');
                    }else if(datatype=="macros"){
                        if(obj.attr('type') == "text"){
                            value= obj.val();
                        }else{
                            if(obj.val() > -1){
                                value = obj.val()+'_'+obj.find("option:selected").text();
                            }
                        }
                    }else if(datatype == "radio"){
                        var name = obj.attr('name');
                        if(!radioArr[obj.attr('name')]){
                            radioArr[obj.attr('name')] = true;
                            if($("input[name='"+name+"']:checked").length>0){
                                value= $("input[name='"+name+"']:checked").val();
                            }else{
                                value = "";
                            }
                        }else{
                            continue;
                        }
                    }else if(datatype == "macrossign"){
                        value= obj.html();

                    }else if(datatype == "fileupload"){
                        value= obj.attr('atturl');
                    }else if(datatype == "imgupload"){
                        var name = obj.attr('name');
                        $('img[name='+name+']').each(function(i,v){
                            var url = $(v).attr('src');
                            if(url!='/img/icon_uploadimg.png'){
                                value+= (url+',');
                            }
                        })
                    }else if(datatype == "sign"){
                        var pre = obj.prev();
                        value = Mustache.render(pre.html(),{content:''});

                    } else if(datatype == "userselect"){
                        value= (obj.attr('user_id')||'')+'|'+ (obj.attr('username')||'');
                    }else if(datatype == "deptselect"){
                        value= (obj.attr('deptid') || '')+'|'+(obj.attr('deptname')||'');
                    }else{
                        value = obj.val();
                    }
                    if(ismust == 'true' && value == ""){
                        flag = true;
                        layer.msg('<fmt:message code="main.th.PleaseFill" />'+obj.attr('title'), {icon: 1});
                        break;
                    }
                    if( value!=null){
                        baseData["key"]=key;
                        baseData["value"]=value;
                        realData.push(baseData);
                    }
                    if(value != ''){
                        modifydata.push(baseData);
                    }
                }

                if(!flag){
                    var fdata={
                        flowId:flowfun.flowId,
                        formdata:JSON.stringify(realData),
                        runId:flowfun.runId,
                        runName:flowfun.runName,
                        beginTime:flowfun.beginTime,
                        beginUser:flowfun.beginUser,
                        formLength:globalData.option.formLength,
                        prcsId : flowStep,
                        flowPrcs : prcsId,
                        modifydata:JSON.stringify(modifydata),
                        fromDataReject:JSON.stringify(fromDataReject),
                        tableName:tableName,
                        tabId:tabId
                    };

                    $.ajax({
                        type: "post",
                        url: "../../workflow/work/nextwork",
                        dataType: 'JSON',
                        data: fdata,
                        success: function(res){
                            var data ={};
                            if(cb){
                                if(res.flag){
                                    data[flag] = true;
                                }else{
                                    data[flag] = false;
                                }
                                data.data = res.obj;
                                data.opt = fdata;
                                cb(data)
                            }
                        }
                    });
                }
            }
            $('.zhuanjiao').on('click',function(){
                if(zw.window.hiddenRight!=undefined){
                    zw.window.hiddenRight();
                }
                //保存表格数据的接口
                saveFlowData(function(res){
                    var formLength=globalData.option.formLength;
                    var obj=globalData.flowRun;
                    var listFp = globalData.listFp
                    var titleName=obj.runName;
                    var prcsTo;
                    var prcsName='';
                    var turnObj = {};
                    var nextFlowid = ''
                    var syncDeal='';
                    var workflowpricToArray = '';
                    if(globalData.flowProcesses.syncDeal == 0){
                        syncDeal = '禁止并发';
                    }else if(globalData.flowProcesses.syncDeal == 1){
                        syncDeal = '允许并发';
                    }else if(globalData.flowProcesses.syncDeal == 2){
                        syncDeal = '为强制并发';
                    }
                    for(var i=0;i<listFp.length;i++){
                        var obj2=listFp[i];
                        if(prcsId == obj2.prcsId){
                            turnObj = obj2;
                            if(obj2.prcsTo!=""){
                                prcsTo= subPric(obj2.prcsTo,",");
                                break;
                            }
                            break;
                        }
                    }
                    if(prcsTo){
                        var indexCurrent = 0;
                        for (var j=0;j<prcsTo.length;j++){
                            if(j == 1){
                                nextFlowid = prcsTo[0];
                            }
                            if(prcsTo[j]=='0'){
                                if(indexCurrent == 0){
                                    prcsName+='<div class="prcsName prcsName_chang" style="" prcsId=0><h1><fmt:message code="main.th.EndProcess" /></h1></div>';
                                }else{
                                    prcsName+='<div class="prcsName " style="" prcsId=0><h1><fmt:message code="main.th.EndProcess" /></h1></div>';
                                }
                                indexCurrent++;
                            }
                            for(var i=0;i<listFp.length;i++){
                                var obj2=listFp[i];
                                if(obj2.prcsId== prcsTo[j]){
                                    checkPrcIn(obj2.prcsIn,obj2.prcsInSet,JSON.parse(res.opt.formdata),JSON.parse(res.opt.fromDataReject),function(res){
                                        if(res.flag){
                                            if(indexCurrent == 0){
                                                indexCurrent++;
                                                prcsName+='<div class="prcsName prcsName_chang" style="" prcsId='+obj2.prcsId+'><h1>'+obj2.prcsName+'</h1></div>';
                                                workflowpricToArray +=  '<li class="workflow-node-result clearfix " id="userSelectBtn_'+obj2.prcsId+'">'+
                                                    '<div class="workflow-node-title"><div class="workflow-node-ops"><input type="button" class="userSelectBtn" name="userSelectBtn" pid="'+obj2.prcsId+'"  value="&nbsp;&nbsp;&nbsp;&nbsp;<fmt:message code="main.th.SelectPersonnel" />"></div> </div>'+
                                                    '<div class="users-select-block"><div id="host_op_block_div2" class="clearfix">'+
                                                    '<input type="hidden" id="PRCS_OP_USER2" data_type="op_user_btn" name="PRCS_OP_USER2" value="admin">'+
                                                    '<input type="hidden" id="PRCS_BACK" name="PRCS_BACK" value=""><div class="sponsor">'+
                                                    '<a href="#" class="prcs-op-uname" id="TOP_FLAG_SHOW2"><fmt:message code="sup.th.Sponsor" />：</a><input type="hidden" id="TOP_FLAG2" name="TOP_FLAG2" value="0">'+
                                                    '<div id="TOP_FLAG_SHOW2_menu" class="attach_div small" style="display: none; top: 33px; left: 153px;">'+
                                                    '<a href="javascript:set_top(0,"2");"><fmt:message code="sup.th.Sponsor" />：</a><a href="javascript:set_top(2,"2");"><fmt:message code="workflow.th.NoSponsorWillSign" />：</a>'+
                                                    '<a href="javascript:set_top(1,"2");"><fmt:message code="main.th.FirstReceiverHosting" />：</a></div></div>'+
                                                    '<textarea class="user-tags" id="remind_name_'+obj2.prcsId+'" user_id=""></textarea></div>'+
                                                    '<div id="prcs_op_block_div2" class="clearfix">'+
                                                    '<input type="hidden" data_type="op_user_btn" id="PRCS_USER2" name="PRCS_USER2" value="admin,">'+
                                                    '<div class="managers"><fmt:message code="workflow.th.Manager" />：</div><textarea class="user-tags" user_id="" id="jingban_'+obj2.prcsId+'"></textarea></div></div></li>';

                                            }else{
                                                if(globalData.flowProcesses.syncDeal != 2){
                                                    prcsName+='<div class="prcsName" style="" prcsId='+obj2.prcsId+'><h1>'+obj2.prcsName+'</h1></div>';

                                                }else{
                                                    prcsName+='<div class="prcsName prcsName_chang" style="" prcsId='+obj2.prcsId+'><h1>'+obj2.prcsName+'</h1></div>';

                                                }
                                                workflowpricToArray +=  '<li class="workflow-node-result clearfix hide" id="userSelectBtn_'+obj2.prcsId+'" >'+
                                                    '<div class="workflow-node-title"><div class="workflow-node-ops"><input type="button" class="userSelectBtn" name="userSelectBtn" pid="'+obj2.prcsId+'"  value="&nbsp;&nbsp;&nbsp;&nbsp;<fmt:message code="main.th.SelectPersonnel" />"></div> </div>'+
                                                    '<div class="users-select-block"><div id="host_op_block_div2" class="clearfix">'+
                                                    '<input type="hidden" id="PRCS_OP_USER2" data_type="op_user_btn" name="PRCS_OP_USER2" value="admin">'+
                                                    '<input type="hidden" id="PRCS_BACK" name="PRCS_BACK" value=""><div class="sponsor">'+
                                                    '<a href="#" class="prcs-op-uname" id="TOP_FLAG_SHOW2"><fmt:message code="sup.th.Sponsor" />：</a><input type="hidden" id="TOP_FLAG2" name="TOP_FLAG2" value="0">'+
                                                    '<div id="TOP_FLAG_SHOW2_menu" class="attach_div small" style="display: none; top: 33px; left: 153px;">'+
                                                    '<a href="javascript:set_top(0,"2");"><fmt:message code="sup.th.Sponsor" />：</a><a href="javascript:set_top(2,"2");"><fmt:message code="workflow.th.NoSponsorWillSign" />：</a>'+
                                                    '<a href="javascript:set_top(1,"2");"><fmt:message code="main.th.FirstReceiverHosting" />：</a></div></div>'+
                                                    '<textarea class="user-tags" id="remind_name_'+obj2.prcsId+'" user_id=""></textarea></div>'+
                                                    '<div id="prcs_op_block_div2" class="clearfix">'+
                                                    '<input type="hidden" data_type="op_user_btn" id="PRCS_USER2" name="PRCS_USER2" value="admin,">'+
                                                    '<div class="managers"><fmt:message code="workflow.th.Manager" />：</div><textarea class="user-tags" user_id="" id="jingban_'+obj2.prcsId+'"></textarea></div></div></li>';

                                            }
                                        }else{
                                            prcsName+='<div class="prcsName" style="" prcsId='+obj2.prcsId+'><span class="tipmsg" msg="'+obj2.conditionDesc.split('\n')[0]+'"><fmt:message code="main.th.NonConformity" /></span><h1>'+obj2.prcsName+'</h1></div>';
                                        }
                                    });

//                                    if(autoTypelist1 && (autoTypelist1 instanceof Array)){
//                                        autoTypelist1.forEach(function(v,i){
//                                            mainprcName += v.userName+',';
//                                            mainprcId += v.userId+',';
//                                            overprcName = v.userName+',';
//                                            overprcId += v.userId+',';
//                                        });
//
//                                    }

                                }
                            }
                        }
                    }
                    //找到表格上的内容
                    var form_item=$('.cont_form .form_item');
                    var realData=[];
                    var radioArr = {};
                    var modifydata =[]
                    var flag = false;

                    $.ajax({
                        type: "get",
                        url: "../../workflow/work/findbranch",
                        dataType: 'JSON',
                        data: {
                            flowId:flowId,
                            flowPrcs:nextFlowid,
                            runId:runId
                        },
                        success: function(obj){
                            var data1 = '';
                            var autoTypelist1 = '';
                            if(obj.flag){
                                data1 = obj.object;
                                if(obj.object){
                                    autoTypelist1 = data1.autoTypelist;
                                    prcsPrivlist = data1.prcsPrivlist;
                                    prcsUserlist = data1.prcsUserlist;
                                    prcsDeptlist = data1.prcsDeptlist;
                                }else{
                                    autoTypelist1 = [];
                                    prcsPrivlist =  [];
                                    prcsUserlist =  [];
                                    prcsDeptlist = [];
                                }
                            }else{
                                //console.log('no auto list')
                            }

                            var prcsFlag = '<fmt:message code="lang.th.Process" />';


                            checkPrcOut(JSON.parse(res.opt.formdata),JSON.parse(res.opt.fromDataReject),function(res){
                                if(res.flag){
                                    var tipMsg = '<fmt:message code="main.th.serialNumber" />：'+globalData.flowRun.runId+'，<fmt:message code="workflow.th.job" />：'+globalData.flowRun.runName
                                    layer.open({
                                        type: 1,
                                        /* skin: 'layui-layer-rim', //加上边框 */
                                        offset: '80px',
                                        area: ['800px', '500px'],
                                        closeBtn: 0,
                                        title:titleName,
                                        content: '<div class="modal-body" style="max-height: 274px;">'+
                                        '<div class="work-prcs-title" id="op_user_show_info" style="margin-bottom: 10px;    height: 18px;font-weight: normal;border-radius: 4px;-webkit-border-radius: 4px;">'+
                                        '<fmt:message code="main.th.currentStep" /><font color="red">'+flowStep+'</font><fmt:message code="workflow.th.step" />['+ globalData.flowTypeModel.flowName+']<font color="red"><div self_type="self" style="display:inline;">'+$.cookie('userName')+'&nbsp;&nbsp;('+prcsFlag+')&nbsp;&nbsp;此步骤'+syncDeal+'</div>'+
                                        '<div style="margin-top: -21px;margin-left: 274px;"></div></font></div><div class="work-prcs-block">'+
                                        '<div class="work-prcs-content clearfix" style="border: 1px solid #f3f3f3;"><div style="width:231px;height:30px;background:#2b7fe0;"><h1 style="margin: 0px 57px;line-height: 30px;color: #f3f3f3;"><fmt:message code="main.th.nextStep" /></h1></div><div class="workflow-procs-nodes-wrap"><ul id="workPrcsData"  class="workflow-procs-nodes"><li class="workflow-node" style="height: 100px;  overflow-y: auto;" id="next_prcs_2">'+
                                        prcsName+'<ol></ol> </li></ul></div><div class="workflow-procs-line"></div><div class="workflow-procs-nodes-result-wrap">'+
                                        '<ul id="work-next-prcs-block" class="workflow-procs-nodes-result" style="top: 0px;">'+workflowpricToArray+

                                        '</ul></div></div></div><div class="work-msg-block">'+
                                        '<div class="work-msg-title"><a id="msg-control" href="#"><img style="vertical-align: text-top; margin-top: 5px;" src="/img/workflow/work/add_work/form_down.png"></a><fmt:message code="main.th.Sendmessage" /></div>'+
                                        '<div class="work-msg-content" style="display: block;"><div class="clearfix">'+
                                        '<div data_type="next" class="work-msg-op-title"><fmt:message code="workflow.th.nextstep" />：<span class="addactiveClass sms-check sms-bg sms-bg-static" data-id="1" title="<fmt:message code="notice.th.remindermessage" />"></span> <span  class=" mobile-check mobile-bg mobile-bg-static" title="<fmt:message code="main.th.SendSMS" />" style="display:none;"></span>'+
                                        '<span data-id="2" class="addactiveClass email-check email-bg email-bg-static" title="<fmt:message code="main.th.SendMail" />"></span>'+
                                        '</div>'+
                                        '<div data_type="create" class="work-msg-op-title"><fmt:message code="workflow.th.Initiator" />：<span data-id="3" class="addactiveClass sms-check sms-bg sms-bg-static" title="<fmt:message code="notice.th.remindermessage" />"></span>'+
                                        '<span class=" mobile-check mobile-bg mobile-bg-static" title="<fmt:message code="main.th.SendSMS" />" style="display:none;"></span>'+
                                        '<span data-id="4" class="addactiveClass email-check email-bg email-bg-static" title="<fmt:message code="main.th.SendMail" />"></span></div>'+
                                        '<div data_type="managers" class="work-msg-op-title"><fmt:message code="doc.th.AllHandlers" />：<span data-id="5" class="addactiveClass sms-check sms-bg sms-bg-static" title="<fmt:message code="notice.th.remindermessage" />"></span> <span class=" mobile-check mobile-bg mobile-bg-static" title="<fmt:message code="main.th.SendSMS" />" style="display:none;"></span>'+
                                        '<span data-id="6" class="addactiveClass email-check email-bg email-bg-static" title="<fmt:message code="main.th.SendMail" />"></span> </div> </div>'+
                                        '<div class="clearfix">'+
                                        '<fmt:message code="main.th.RemindHandler" />： <input type="hidden" name="remind_others_id" id="remind_others_id" value="">'+
                                        '<textarea name="remind_others_name" id="remind_others_name" readonly="" style="width:376px;"></textarea>&nbsp;'+
                                        '<a class="orgAdd" id="others-add"><fmt:message code="global.lang.select" /></a>&nbsp;'+
                                        '<a class="orgClear" id="others-clear" href="javascript:ClearUser("remind_others_id", "remind_others_name");"><fmt:message code="global.lang.empty" /></a>'+
                                        '</div>'+
                                        '<div class="work-msg-sms-block">'+
                                        '<fmt:message code="main.th.ReminderContent" />：<input type="text" style="width: 600px;" name="SMS_CONTENT" id="SMS_CONTENT" value="'+tipMsg+'">'+
                                        ' </div></div></div></div>',

                                        btn:['<fmt:message code="global.lang.ok" />', '<fmt:message code="depatement.th.quxiao" />'],
                                        success: function(layero,index){
                                            var mainprcName = '';
                                            var overprcName = '';
                                            var mainprcId = '';
                                            var overprcId = '';

                                            $('#remind_name').val(mainprcName);
                                            $('#remind_name').attr('user_id',mainprcId);
                                            $('#jingban').val(overprcName);
                                            $('#jingban').attr('user_id',overprcId);
                                            var firtnode = $('#next_prcs_2 .prcsName_chang');
                                            if(firtnode.attr('prcsid') == '0'){
                                                $('#work-next-prcs-block').hide();
                                            }
                                            $('.addactiveClass').click(function () {
                                                if($(this).hasClass('active')){
                                                    $(this).removeClass('active')
                                                }else {
                                                    $(this).addClass('active')
                                                }
                                            })
                                            //调取选人控件
                                            $('#work-next-prcs-block').on('click','.userSelectBtn',function(){
                                                var pid = $(this).attr('pid');
                                                UserItemMain = 'remind_name_'+pid;
                                                UserItem = 'jingban_'+pid;
                                                $.popWindow("/common/selectUserWorkFlow");
                                            })

                                            //底部选择人员
                                            $('#others-add').on('click',function(){
                                                user_id='remind_others_name';
                                                $.popWindow("/common/selectUser");
                                            })
                                            //折叠
                                            $('#msg-control').on('click',function(){
                                                if($('#msg-control').find('img').attr('src')=='/img/workflow/work/add_work/form_down.png'){
                                                    $('#msg-control').find('img').attr('src','/img/workflow/work/add_work/from_right.png')
                                                }else{
                                                    $('#msg-control').find('img').attr('src','/img/workflow/work/add_work/form_down.png')
                                                }
                                                $('.work-msg-content').slideToggle();
                                            });
                                            //点击下一步骤，样式的改变
                                            if(globalData.flowProcesses.syncDeal == 2){
                                                $('#work-next-prcs-block li').show();
                                            }else if(globalData.flowProcesses.syncDeal == 1){
                                                $('.workflow-procs-nodes-wrap').on('click','.prcsName',function(){
                                                    var _this = $(this);
                                                    if(_this.find('.tipmsg').length>0){
                                                        var msg = _this.find('.tipmsg').attr('msg')
                                                        $.layerMsg({content:msg,icon:0},function(){

                                                        });
                                                    }else{
                                                        if(nextFlowid != 0){
                                                            var nextFlowid = _this.attr("prcsid");
                                                            if(_this.attr('class').indexOf('prcsName_chang') == -1){
                                                                _this.addClass('prcsName_chang');
                                                                _this.attr('check','1');
                                                                $('#userSelectBtn_'+nextFlowid).show();
                                                            }else{
                                                                if($('.prcsName_chang').length>1){
                                                                    _this.removeClass('prcsName_chang');
                                                                    _this.attr('check','0');
                                                                    $('#userSelectBtn_'+nextFlowid).hide();
                                                                }
                                                            }
                                                        }
                                                    }
                                                });
                                            }else{
                                                $('.workflow-procs-nodes-wrap').on('click','.prcsName',function(){
                                                    var _this = $(this);
                                                    if(_this.find('.tipmsg').length>0){
                                                        var msg = _this.find('.tipmsg').attr('msg')
                                                        $.layerMsg({content:msg,icon:0},function(){

                                                        });
                                                    }else{
                                                        if(nextFlowid != 0){
                                                            _this.siblings().removeClass('prcsName_chang');
                                                            _this.addClass('prcsName_chang');
                                                            _this.siblings().attr('check','0');
                                                            _this.attr('check','1');
                                                            var nextFlowid = _this.attr("prcsid");
                                                            $('#userSelectBtn_'+nextFlowid).show().siblings().hide();
                                                            $.ajax({
                                                                type: "get",
                                                                url: "../../workflow/work/findbranch",
                                                                dataType: 'JSON',
                                                                data: {
                                                                    flowId: globalData.flowRun.flowId,
                                                                    flowPrcs: nextFlowid,
                                                                    runId: globalData.flowRun.runId
                                                                },
                                                                success: function (obj) {
                                                                    $('#work-next-prcs-block').show();
                                                                    var option = obj.object;
                                                                    var autoTypelist ='';
                                                                    var mainprcName = '';
                                                                    var overprcName = '';
                                                                    var mainprcId = '';
                                                                    var overprcId = '';
                                                                    if(option){
                                                                        autoTypelist = option.autoTypelist;
                                                                        prcsPrivlist = option.prcsPrivlist;
                                                                        prcsUserlist = option.prcsUserlist;
                                                                        prcsDeptlist = option.prcsDeptlist;
                                                                    }else{
                                                                        autoTypelist = [];
                                                                        prcsPrivlist = [];
                                                                        prcsUserlist = [];
                                                                        prcsDeptlist = [];
                                                                    }
                                                                    if(autoTypelist && (autoTypelist instanceof Array)){
                                                                        autoTypelist.forEach(function(v,i){
                                                                            mainprcName += v.userName+',';
                                                                            mainprcId += v.userId+',';
                                                                            overprcName = v.userName+',';
                                                                            overprcId += v.userId+',';
                                                                        });

                                                                    }
                                                                    $('#remind_name').val(mainprcName);
                                                                    $('#remind_name').attr('user_id',mainprcId);
                                                                    $('#jingban').val(overprcName);
                                                                    $('#jingban').attr('user_id',overprcId);

                                                                }
                                                            });
                                                        }else{
                                                            $('#work-next-prcs-block').hide();
                                                        }

                                                    }


                                                })
                                            }

                                        },
                                        yes: function(index, layero){
                                            //按钮【按钮三】的回调
                                            //新建工作之后的保存接口，跳转到我的工作页面
                                            var ret=globalData.flowRun;
                                            var ret3=globalData.flowRunPrcs;
                                            var pId = [];
                                            var beginUser = [];
                                            var jingbanUser = [];
                                            var flag = true;
                                            $('#workPrcsData .prcsName_chang').each(function(){
                                                var prcsid = $(this).attr('prcsid');
                                                pId.push(prcsid);
                                                var bu = $('#remind_name_'+prcsid).attr('user_id');
                                                if(bu == ''){
                                                    flag = false;
                                                }
                                                beginUser.push(bu);
                                                jingbanUser.push($('#jingban_'+prcsid).attr('user_id'));
                                            });
                                            if( !flag &&$('#next_prcs_2 .prcsName_chang').find('h1').text()!='<fmt:message code="main.th.EndProcess" />'){
                                                $.layerMsg({content:'<fmt:message code="sup.th.SelectTheSponsor" />！',icon:0},function(){
                                                    return false;
                                                });
                                            }else{
                                                if($('#next_prcs_2 .prcsName_chang').find('h1').text()=='<fmt:message code="main.th.EndProcess" />'){
                                                    savedData={
                                                        flowId:ret.flowId,
                                                        runId:ret.runId,
                                                        runName:ret.runName,
                                                        beginTime:ret.beginTime,
                                                        beginUser:beginUser.join(','),
                                                        prcsId:ret3.prcsId,
                                                        prcsflag:1,
                                                        flowPrcs:pId.join(','),
                                                        jingbanUser:jingbanUser.join('|'),
                                                        tableName:tableName,
                                                        tabId:tabId
                                                    }
                                                }else{
                                                    savedData={
                                                        flowId:ret.flowId,
                                                        runId:ret.runId,
                                                        runName:ret.runName,
                                                        beginTime:ret.beginTime,
                                                        beginUser:beginUser.join(','),
                                                        prcsId:ret3.prcsId,
                                                        flowPrcs:pId.join(','),
                                                        prcsflag:1,
                                                        jingbanUser:jingbanUser.join('|'),
                                                        tableName:tableName,
                                                        tabId:tabId
                                                    }
                                                }
                                                var smsTypes=''
                                                var smsTypesArr=$('.addactiveClass');
                                                for(var i=0;i<smsTypesArr.length;i++){
                                                    if($(smsTypesArr[i]).hasClass('active')){
                                                        smsTypes+=$(smsTypesArr[i]).attr('data-id')+','
                                                    }else {
                                                        smsTypes+=','
                                                    }
                                                }
                                                savedData.smsType=smsTypes;
                                                savedData.smsContent=$('#SMS_CONTENT').val()
                                                savedData.orgAdd=$('#remind_others_name').attr('user_id')
                                                //保存的接口
                                                $.ajax({
                                                    type: "post",
                                                    url: "../../workflow/work/saveWork",
                                                    dataType: 'JSON',
                                                    data: savedData,
                                                    success: function (obj) {
                                                        if(obj.flag==true){
                                                            $.layerMsg({content:'<fmt:message code="diary.th.modify" />！',icon:1},function(){
                                                                window.opener.location.reload();
                                                                window.close();
                                                                parent.opener.runWorkListPage();
                                                                //parent.opener.location.href='workList';
                                                            });
                                                        }else{
                                                            $.layerMsg({content:'<fmt:message code="meet.th.SaveFailed" />！',icon:1},function(){

                                                            });
                                                        }
                                                    }
                                                });
                                                layer.closeAll();
                                            }

                                        },
                                        btn2:function (index) {
                                            if(zw.window.showRight!=undefined){
                                                zw.window.showRight();
                                            }
                                        }
                                    });
                                }else{
                                    $.layerMsg({content:res.msg,icon:0},function(){

                                    });
                                }

                            });


                        }
                    });
                });
            });
            function otherFlowRflect(tableName,tableId,runId){
                if(tableName && tableName!='' && tableId!='' && runId !=''){
                    $.ajax({
                        type: "post",
                        url: "../../tigger/modifyFieldProperties",
                        dataType: 'JSON',
                        data: {
                            tableName:tableName,
                            id:tableId,
                            runId:runId
                        },
                        success: function(res){
                            //console.log(res);
                        }
                    })
                }
            }

        });
    </script>
    <script type="text/javascript">
        var TANGER_OCX_OBJ;
        function init()
        {
            TANGER_OCX_OBJ=document.getElementById("TANGER_OCX");
            TANGER_OCX_OBJ.activate(true);
            if(window.navigator.platform=="Win64"){
                TANGER_OCX_OBJ.AddDocTypePlugin(".pdf","PDF.NtkoDocument","4.0.0.2","../../lib/officecontrol/ntkooledocallx64.cab",51,true);
            }else{
                TANGER_OCX_OBJ.AddDocTypePlugin(".tif","tif.NtkoDocument","4.0.0.2","../../lib/officecontrol/ntkooledocall.cab",51,true);
                TANGER_OCX_OBJ.AddDocTypePlugin(".pdf","PDF.NtkoDocument","4.0.0.2","../../lib/officecontrol/ntkooledocall.cab",51,true);
            }
            TANGER_OCX_OBJ.CreateNew("word.document");
        }
        /*
         *  func 从本地附件套红功能filename='C:\Users\gsb\Desktop\test.dot'
         *  string filename 必选  本地模板的路径
         *  bool [PromptSelect] 是否允许用户选择
         *  bool [IsConfirmConversions] 当模板文件不是WORD类型时，是否提示转换，默认true
         * */
        function red_chromatography_local(){//套红
            //AddTemplateFromLocal(filename, [PromptSelect], [IsConfirmConversions]);
            var filename = 'test.dot';
            TANGER_OCX_OBJ.AddTemplateFromLocal(filename);//此处不能为空，必须带一个参数
        }
        /*
         *  func 从url套红功能
         *  string URL 必选  远程模板文件URL
         *  bool [IsConfirmConversions] 当模板文件不是WORD类型时，是否提示转换，默认true
         * */
        function red_chromatography_url(){//套红可用，加载服务器资源下的，路径如下
            //TANGER_OCX_OBJ.AddTemplateFromURL(URL,[IsConfirmConversions]);
            var URL='/file/pjc/test.dot';
            TANGER_OCX_OBJ.AddTemplateFromURL(URL);
        }
        /*
         * 进入或者退出保留痕迹
         * bool vbool 是否保留痕迹
         * */
        /*function TrackRevisions(vbool){
         //var vbool = $('#TrackRevisions option:selected').val();
         TANGER_OCX_OBJ.TrackRevisions(vbool);
         }*/
        /*
         * 强制进入或者退出保留痕迹
         * bool vbool 是否保留痕迹
         * */
        function EnterRevisionMode(id){
            // var vbool = $('#TrackRevisions option:selected').val();
            var domID = document.getElementById(id);
            var vbool = domID.value;
            TANGER_OCX_OBJ.EnterRevisionMode(vbool);
        }
        /*
         * 该函数使用HTTP协议将文件保存到URL
         * string URL 处理后台保存的URL地址
         * String FileFieldName 控件文件域名称
         * string FileName 文件名
         * bool IsShowUI 是否显示进度条
         * return 提交URL之后从服务器返回的数据
         * */
        function SaveToURL(){
            //TANGER_OCX_OBJ.SaveToURL("/upload","DocFile","","NewDoc.doc",1);
            TANGER_OCX_OBJ.SaveToURL("../../upload?module=email","file","","/file/pjc/test.dot","upload_file");
        }
        /*
         * string SaveAsDocument 保存到本地的文档路径 可选
         * bool OverwriteExisting 是否覆盖现文件 可选
         * bool isPrompt 是否提示用户选择 可选
         * */
        function SaveToLocal(){//可用
            //TANGER_OCX_OBJ.SaveToLocal([SaveAsDocument], [OverwriteExisting], [isPrompt]);
            var SaveAsDocument = 'D:/test1.doc';
            TANGER_OCX_OBJ.SaveToLocal(SaveAsDocument);
        }
        //打印功能
        function doc_print(){
            //alert("a")；
            TANGER_OCX_OBJ.PrintPreview();
            TANGER_OCX_OBJ.PrintOut();

        }
    </script>

</body>
</html>